﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UCSignature.ascx.cs" Inherits="MTRC.ODMS.Web.SOM.UserControl.UCSignature" %>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
<link href="<%=ResolveUrl("~/CSS/common.css")%>" rel="stylesheet" type="text/css" /> 
<script  type="text/jscript" language="JavaScript" src="../../Javascript/CommonFunction.js"></script> 

<script language="javascript" type="text/javascript">
//------------------------------20090121--------------//huangyao 20090122 fixed TD:1156
function SetControlOwnSameValue(strClientID)
{
//    debugger;
//    var findString = "Bottom";
//    var radioObjectName2; // = strClientID + '_hdnSignFileName'; 
//	var tempValue2; // = window.document.getElementById(radioObjectName2).value;
//	if(strClientID.indexOf(findString) > -1)
//	{
//	    radioObjectName2 = strClientID + "_hdnSignFileName"; 
//	    tempValue2 = window.document.getElementById(radioObjectName2).value;
//	    
//	    var controlName = strClientID.substring(0, strClientID.indexOf(findString) ) + "_hdnSignFileName";
//	    if(window.document.getElementById(controlName) != null)
//	    {
//	        window.document.getElementById(controlName).value = tempValue2;
//	    }
//	}
//	else
//	{
//		radioObjectName2 = strClientID + '_hdnSignFileName'; 
//	    tempValue2 = window.document.getElementById(radioObjectName2).value;
//	    
//	    var controlName = strClientID + findString + "_hdnSignFileName";
//	    if(window.document.getElementById(controlName) != null)
//	    {
//	        window.document.getElementById(controlName).value = tempValue2;
//	    }
//	}
}

function OpenPhotoCaptureForm(isReadOnly, eventSignType, signatureFullFileName, strClientID) 
{
    //debugger;
    var result;
	var urlPhotoCapture;
	urlPhotoCapture='../../SOM/Popup/PopupPhotoCaptureContainer.htm?isReadOnly=' + isReadOnly + "&eventSignType=" + eventSignType  + '&FormTitle=<%=this.GetLabel("SOM_SignType_PhotoCapture")%>' + '&signatureFullFileName=' + signatureFullFileName;
    
    result = window.showModalDialog(urlPhotoCapture, "newwin1", "DialogWidth:333px;DialogHeight:305px;help:no;status:no;scroll:no"); //scroll:no
    
    //window.document.getElementById('<%=this.hdnSignType.ClientID%>').value = "1";  //means Cap Photo
    var radioObjectName = strClientID + '_hdnSignType'; 
    window.document.getElementById(radioObjectName).value = "1";  //means Cap Photo
    if(isReadOnly != "true")
    {
        __doPostBack(document.getElementById('<%=this.hdnForRefresh.ClientID%>').id, "")
    }
    
    //--//SetControlOwnSameValue(strClientID);
}

function OpenHandWrittenForm(isReadOnly, eventSignType, signatureFullFileName, strClientID) 
{
    var result;
	var urlSignature;
	//var encodedFormTitle = encodeURI('<%=this.GetLabel("SOM_SignType_PhotoCapture")%>');
	urlSignature='../../SOM/Popup/PopupSignatureContainer.htm?isReadOnly=' + isReadOnly + '&eventSignType=' + eventSignType  + '&FormTitle=<%=this.GetLabel("SOM_SignType_HandWritten")%>' + '&signatureFullFileName=' + signatureFullFileName;
    //alert(document.getElementById(CONTROL_SignFileName).value);
    result = window.showModalDialog(urlSignature, "newwin1", "DialogWidth:260px;DialogHeight:210px;help:no;status:no;scroll:no"); //scroll:no	
    
    //window.document.getElementById('<%=this.hdnSignType.ClientID%>').value = "2"; //means Handwritten
    var radioObjectName = strClientID + '_hdnSignType'; 
    window.document.getElementById(radioObjectName).value = "2";
    if(isReadOnly != "true")
    {
        __doPostBack(document.getElementById('<%=this.hdnForRefresh.ClientID%>').id, "")
    }
    
    //--//SetControlOwnSameValue(strClientID);
}
//------------------------------20090121--------------


</script>
<table border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td>
            <asp:Label ID="lblSignature" runat="server" Text="Signature:" Width="100%"></asp:Label>
        </td>
        <td style="width: 105px;">
            <asp:Button ID="btnPhotoCapture" runat="server" Text="Photo Capture" Width="100px" />
        </td>
        <td style="width: 105px;">    
            <asp:Button ID="btnHandWritten" runat="server" Text="Handwritten" Width="100px" />
        </td>
        <td align="left" style="width: 30px;">
            <asp:Image ID="imgSignature" runat="server" ImageUrl="~/Images/SOM/Sign_UnSignature.gif" BorderColor=gray BorderWidth=1 />
            <asp:Image ID="imgBookOnUnSigPic" runat="server" ImageUrl="~/Images/SOM/Sign_UnSignature.gif" BorderColor=gray BorderWidth=1 style="display: none" />
            <asp:Image ID="imgBookOnSigPic" runat="server" ImageUrl="~/Images/SOM/Sign_Signature.gif" BorderColor=gray BorderWidth=1 style="display: none" />
        </td>
        <td align="left">
            <asp:button Visible="false" id="btnOpenCapture" runat="server" Text="..." ToolTip="Show Book On Signature details panel"></asp:button>  <%--//huangyao 20090122 fixed TD:1156--%>
            <INPUT type="hidden" id="hdnSignFileName" name="hdnSignFileName" value="" runat="server">
            <INPUT type="hidden" id="hdnSignType" name="hdnSignType" value="" runat="server">
            <INPUT type="hidden" id="hdnForRefresh" name="hdnForRefresh" value="Intial Value" runat="server" onserverchange="hdnForRefresh_ServerChange">
            <INPUT type="hidden" id="hdnEventNo" name="hdnEventNo" value="" runat="server">
        </td>
    </tr>
</table>
